import smtplib
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
username = 'hongwu.ma@gmail.com'
recipient = 'hma2@inf.ed.ac.uk'
password = 'mhw314'
msg = MIMEMultipart()
msg['From'] = username
msg['To'] = recipient
msg['Subject'] = 'new EHMN user'
text='asdf'
msg.attach(MIMEText(text))
server = smtplib.SMTP('smtp.gmail.com:587')
#server.set_debuglevel(1)
server.ehlo()
server.starttls()
server.ehlo()
server.login(username,password)
server.sendmail(username, recipient, msg.as_string())
server.quit()